package demo3;

//抽象类

abstract class Shape {
    public abstract void draw();//抽象方法
}

class Cycle extends Shape{
    public void draw(){
        System.out.println("⚪");
    }
}

class Rect extends Shape {
    @Override
    public void draw() {
        System.out.println("⬜");
    }
}

public class Test{
    public static void drawMap(Shape shape) {
        shape.draw();
    }

    public static void main(String[] args) {
        Shape shape1 = new Cycle();
        Shape shape2 = new Rect();
        drawMap(shape1);
        drawMap(shape2);
    }
}













